package org.szgb.console.zx.dashboard.web;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.szgb.console.zx.dashboard.service.ZxDashboardService;
import org.szgb.core.utils.AjaxJson;

@Slf4j
@RestController
@RequestMapping(value = "/zx/dashboard")
@Tag(name = "专项看板管理", description = "专项看板管理模块")
public class ZxDashboardController {
    private final ZxDashboardService zxDashboardService;

    @Autowired
    public ZxDashboardController(ZxDashboardService zxDashboardService) {
        this.zxDashboardService = zxDashboardService;
    }
    @PostMapping("/getDashboardData")
    @Operation(summary = "获得看板数据", description = "获得看板数据。")
    public AjaxJson getDashboardData(HttpServletRequest request, HttpServletResponse response) {
        // 根据保存结果返回相应的AjaxJson对象
        return AjaxJson.success("成功", request, response).put("ZxDashboard",zxDashboardService.getDashboardData());
    }
}
